const api = require('../config/config').api,
      Model = require('../lib/Model');

//index model class
class IndexModel extends Model {
  //index 获取数据的模型 传配置项
  getXiaomiDatas (options){
    const swiper = options.swiper,
          phone = options.phone,
          field = options.field;
    const url = `${api.getXiaomiDatas}?swiper=${swiper}&phone=${phone}&field=${field}`;

    return this.get(url, {
      success(res) {
        return res;
      },
      error(err){
        throw new Error('error: ' + err);
      }
    });
  }
}

module.exports = new IndexModel(); //实例化
